package com.smartlight.godlight.model;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

public class Buddha implements Parcelable {
    public int id;
    public String name;
    public String img;
    public int start_num;
    public int end_num;

    public Buddha(String name, String img){
        this.name = name;
        this.img = img;
    }

    protected Buddha(Parcel in) {
        id = in.readInt();
        name = in.readString();
        img = in.readString();
        start_num = in.readInt();
        end_num = in.readInt();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(name);
        dest.writeString(img);
        dest.writeInt(start_num);
        dest.writeInt(end_num);
    }

    public static final Creator<Buddha> CREATOR = new Creator<Buddha>() {
        @Override
        public Buddha createFromParcel(Parcel in) {
            return new Buddha(in);
        }

        @Override
        public Buddha[] newArray(int size) {
            return new Buddha[size];
        }
    };

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getImg() {
        return img;
    }

    public int getStart_num() {
        return start_num;
    }

    public int getEnd_num() {
        return end_num;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @NonNull
    @Override
    public String toString() {
        return "Id:" + getId() + "\n"
                + "name: " + getName()
                + "img: " + getImg()
                + "start_num: " + getStart_num()
                + "end_num: " + getEnd_num();

    }
}
